namespace ZFramework.Runtime
{
    public partial class EntityMgr
    {
        private sealed class InternalShowEntityInfo : IReference
        {
            private int m_SerialId;
            private int m_EntityId;
            private EntityGroup m_EntityGroup;
            private ShowEntityInfo m_UserData;

            public InternalShowEntityInfo()
            {
                m_SerialId = 0;
                m_EntityId = 0;
                m_EntityGroup = null;
                m_UserData = null;
            }

            public int SerialId
            {
                get { return m_SerialId; }
            }

            public int EntityId
            {
                get { return m_EntityId; }
            }

            public EntityGroup EntityGroup
            {
                get { return m_EntityGroup; }
            }

            public ShowEntityInfo UserData
            {
                get { return m_UserData; }
            }

            public static InternalShowEntityInfo Create(int serialId, int entityId, EntityGroup entityGroup,
                ShowEntityInfo userData)
            {
                InternalShowEntityInfo internalShowEntityInfo = ReferencePool.Acquire<InternalShowEntityInfo>();
                internalShowEntityInfo.m_SerialId = serialId;
                internalShowEntityInfo.m_EntityId = entityId;
                internalShowEntityInfo.m_EntityGroup = entityGroup;
                internalShowEntityInfo.m_UserData = userData;
                return internalShowEntityInfo;
            }

            public void Clear()
            {
                m_SerialId = 0;
                m_EntityId = 0;
                m_EntityGroup = null;
                m_UserData = null;
            }
        }
    }
}